﻿
Partial Class Paginas_CuponConvenio
    Inherits System.Web.UI.Page

    Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
        If Not Page.IsPostBack Then
            Dim ConvenioID As Integer = Request.QueryString("ConvenioID")

            Dim NegocioP As New dllNegocio.NegPersonas(System.Configuration.ConfigurationManager.AppSettings.Get("SPECBDD").ToString.Trim)
            Dim objUsr As New dllEntidades.clsFuncionario
            Try
                objUsr = NegocioP.BuscaPersona(Session("RutUsuario"))
                Me.lblNombre.Text = objUsr.Nombre & " " & objUsr.ApellidoPaterno & " " & objUsr.ApellidoMaterno
                Me.lblRut.Text = objUsr.Rut
            Catch ex As Exception
            Finally
                NegocioP.Dispose()
                NegocioP = Nothing
                objUsr.Dispose()
                objUsr = Nothing
            End Try

            Dim objNegConv As New dllNegocio.NegConvenios(System.Configuration.ConfigurationManager.AppSettings.Get("SPECBDD"))
            Dim myCollect As Collection
            Dim objConv As New dllEntidades.clsConvenio
            Try
                Me.lblCantiAsis.Text = Request.QueryString("CantAsis")
                myCollect = objNegConv.ListarConvenios(ConvenioID, "TODOS", 0)
                If myCollect.Count > 0 Then
                    objConv = myCollect.Item(1)
                    Me.lblNombreConvenio.Text = objConv.Nombre
                    Me.lblTipAsistente.Text = objConv.TipoAsistente.Trim
                    Me.lblCondiciones.Text = objConv.Condiciones
                    Me.lblDescripcion.Text = objConv.Descripcion
                End If

                Me.lblLit.Text = "<img src='img/ImgLoad/Convenios/" & objConv.ImagenMail.ToString.Trim & "' alt='' height='400' width='500' />"
                Me.litImg.Text = "<img src='img/ImgLoad/Imagenes/" & objConv.Imagen.ToString.Trim & "' alt='' height='80' width='268' />"
            Catch ex As Exception
            Finally
                objNegConv.Dispose()
                objNegConv = Nothing
                myCollect = Nothing
                objConv.Dispose()
                objConv = Nothing
            End Try

        End If
    End Sub
End Class
